<template>
  <div></div>
</template>

<script>
import { login, saveAudit } from '@/api/h4aOauth'
import localStorage from '@/utils/localStorage'
// import store from '../../store'

export default {
  created() {
    let hashUrl = window.location.hash
    let urlParams = hashUrl.split('?')[1]
    let paramsObj = {}
    if (urlParams) {
      let keyValue = urlParams.split('&')
      for (let i = 0; i < keyValue.length; i++) {
        let item = keyValue[i].split('=')
        let paramsKey = item[0]
        paramsObj[paramsKey] = item[1] || ''
      }
    }
    localStorage.setLocalStorage('lastTokenType', 'H4a')
    if (this.$store.getters['app/token'] != '') {
      this.$router.push('/home')
    } else {
      let realId = paramsObj.hasOwnProperty('realId') ? paramsObj['realId'] : ''
      let apk =
        '6cSjA%252Bq%252F4UjmWfBkZOSRUoyPJ4RBzQyXbxM2NrNKdOtGgjQ0NfZ4jW28PjSX%252B%252BR900lF3fwBjNv4H6QIGFmdp3DPN9s7gxg3Ar9GJJwCGxwx%252BT%252Fz6mux3a6TA1uVDPps4Un%252FiPgAHoL7aLVkaF78rjr2grzx5i4ReWBKp%252BsoU6%252BYuNE9lDwImq%252BQzADK56MYLHQJtbzttoCi95r4zfORZvkz9yCdKwczluklZpe8dAipYy1dFmJ2xzY4vb5ZoGlN0%252B4MSQYHEe857kBKTdRgX2QzaF0eNOpPdiMtWn5ICNQHc0QzEG%252FU6wQ1ReYO%252FiHI6IeBTE0stLE%253D'
      paramsObj.hasOwnProperty('appId') ? login(paramsObj['appId'], apk, realId) : login('WXPIRDP', apk, realId)
    }
  },
  methods: {}
}
</script>

<style lang="less" scoped></style>
